<%@ page import="com.vo.Students" %>
<%@ page import="com.dbc.StudentsDB" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>do update</title>
    <style>
        .main{
            text-align: center;
            border-radius: 20px;
            width: 300px;
            height: 200px;
            margin: auto;
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
        }
    </style>
</head>
<body>
<div class="main">
<%
    request.setCharacterEncoding("utf-8");
    if(request.getParameter("studentId")!=null&&request.getParameter("studentName")!=null){
        String studentId=request.getParameter("studentId");
        String studentName=request.getParameter("studentName");
        String studentPwd=request.getParameter("studentPwd");
        String sex=request.getParameter("sex");
        int classId=Integer.parseInt(request.getParameter("classId"));

        Students stu=new Students(studentId,studentName,studentPwd,sex,classId);
        StudentsDB sdb=new StudentsDB();
        if(sdb.updateStudents(stu)>0){%>
            <h3>成功修改<%=stu.getStudentName()%>同学的信息</h3>
        <%}else{ %>
            <h3>修改失败!</h3>
        <%}
    } %>
</div>
</body>
</html>
